﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" href="${pageContext.request.contextPath}/ztree/css/zTreeStyle/zTreeStyle.css" />
<script src="${pageContext.request.contextPath}/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ztree/js/jquery.ztree.all.min.js" type="text/javascript"></script>

<script type="text/javascript">
		var setting = {
			async: {
				enable: true,
				url: "${pageContext.request.contextPath}/permission?method=getPermissionAll",
			},
			data: {
				simpleData: {
					enable: true,
					pIdKey: "pid",
				}
			},
			callback:{
				onClick:function(event, treeId, treeNode){
					parent.workareaFrame.location = "${pageContext.request.contextPath}/permission?method=getPermissionById&id="+treeNode.id;
					let zTreeObj = $.fn.zTree.getZTreeObj("permission_tree");
					let array = new Array();
					let selectedNodes = zTreeObj.getSelectedNodes();
					let children = selectedNodes[0].children;


				}
			}
		};
			$(document).ready(function(){
				$.fn.zTree.init($("#permission_tree"), setting);
			});
		</script>
<ul id="permission_tree" class="ztree">
</ul>
